<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="类别">
        <el-input v-model="form.g_name"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="submitForm()">注册</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: "GoodsAdd",
    data(){
      return{
        form:{
          g_name:''
        }
      }
    },
    methods:{
      submitForm(){
        this.$axios.post('/GoodsServlet/addGoods?g_name=' + this.form.g_name)
          .then(resp=>{
            this.$router.push('/goods/list')
          })
      }
    }
  }
</script>

<style scoped>

</style>
